home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 4277 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.7 KB

  1. Path: news.tu-chemnitz.de!fachat
  2. From: fachat@physik.tu-chemnitz.de (Andre Fachat)
  3. Newsgroups: comp.sys.cbm,comp.os.misc,alt.comp.hardware.homebuilt,comp.sys.apple2,comp.sys.apple2.programmer,comp.sys.atari.8bit
  4. Subject: Re: 6502 Multitasking OS announce
  5. Followup-To: comp.sys.cbm,comp.os.misc,alt.comp.hardware.homebuilt,comp.sys.apple2,comp.sys.apple2.programmer,comp.sys.atari.8bit
  6. Date: 20 Mar 1996 12:01:37 GMT
  7. Organization: University of Technology Chemnitz, FRG
  8. Message-ID: <4ios31$9b6@narses.hrz.tu-chemnitz.de>
  9. References: <4i94fs$stj@narses.hrz.tu-chemnitz.de> <holger.948.00030EE6@deep.hb.provi.de> <4ijtbe$7ca@no-names.nerdc.ufl.edu> <4ijuic$iiq@gatekeeper.liffe.com> <4ik00v$9r@fishlab7.fsh.mtu.edu> <4im8k0$gud@gatekeeper.liffe.com> <4iml11$s69@narses.hrz.tu-chemnitz.de> <4imo7b$36m@gatekeeper.liffe.com>
  10. NNTP-Posting-Host: dag.physik.tu-chemnitz.de
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Ralph Mason (ralph.mason@liffe.com) wrote:
  14. : You have sorta missed what I was meaning here.  Sure you can map code
  15. : around here and there - but if many processes are going to use the
  16. : same routines the routienes better not use any global data.  These
  17. : routine should use the stack for any working data. I guess you use no
  18. : absolute jumps :-)
  19.  
  20. I do use absolute jumps. With an MMU, each task has its own kind of 
  21. virtual machine. you can jump anywhere you want.
  22. Without MMU, only tasks that use different memory locations -
  23. in the zeropage, other RAM and program address space - can coexist.
  24.  
  25.  
  26. : what about a eor ?  
  27.  
  28. : you pass in the critial section as the adress and eor that adress with
  29. : say 1
  30.  
  31. : if
  32.  
  33. : wait:
  34. :     cmp addr,0
  35. :     beq get
  36. :     call scheduler yeild function
  37. :     jmp wait
  38. : get: 
  39. :     eor addr,1
  40. :     jz wait
  41.  
  42. : ..you should have the critical section here
  43.  
  44. This version doesn't work. If the task gets interrupted between the 
  45. cmp and the eor, another task can eor the address and enter the critical
  46. region. After the first task gets back, it eor's the address again, 
  47. making it zero again and then having free entry to the critical region.
  48. Boom.
  49.  
  50. But then, as many have pointed out, the 6502 has some test&set like
  51. operations, i.e. the 'shift' and the 'inc/dec'  operations. One
  52. can surely build semaphores with them too.
  53.  
  54. But in my OS, all possible blocks are done with the scheduler that
  55. puts the task to sleep instead of letting it spinlock, wasting CPU time.
  56. And interrupt routines should never block - so they can only call
  57. save - i.e. with SEI protected - routines.
  58.  
  59. Andre
  60.  
  61. --
  62. fachat@physik.tu-chemnitz.de | Andre Fachat,        Phone: ++49-371-531-3551
  63. -----------------------------| Vettersstr. 72/622,  09126 Chemnitz,  Germany
  64. Distribution via the         |---------------------------------------------- 
  65. Microsoft Network prohibited!| Unix was invented prior to user-friendlyness!
  66.